from lxml import  etree

def getInfo(listInfo):
    parser=etree.HTMLParser(encoding='utf-8')
    html=etree.parse('collection/tengxun.html',parser=parser)
    text=html.xpath('//span//text()')
    # print(text)
    l=0
    fomation={
        'English':None,
        'addr':None,
        'work':None,
        'date':None
    }

    for i in text:
        print(l)
        if l==0:
            a=fomation.copy()
            a['English']=i
        if l==1:
            a['addr']=i
        if l==2:
            a['work']=i
        if l==3:
            a['date']=i
        if l==4:
            l=-1
            listInfo.append(a)
        l+=1


listInfo=[]
getInfo(listInfo)
print(listInfo)
